{% set namespace = "acs_sls_dashboard" %}
{% set dff_api_title = "AlibabaCloud-SLS Metric Collection" %}
{% set dff_api_crontab = "* * * * *" %}

{% extends "base_template" %}
{% block import %}
{{ super() }}
import integration_alibabacloud_monitor__main as monitor_main
{% endblock %}

{% block account %}
{{ super() }}
{% endblock %}

{% block collect_configs %}
monitor_configs = {
    'targets': [
        {
            'namespace': 'acs_sls_dashboard',
            'metrics'  : [
                'AlarmIPCount', 'AlarmPV', 'AlarmUV', 'ConsumerGroupFallBehind',
                'FailedLines', 'InflowLine', 'LogCodeQPS', 'LogInflow','LogMethodQPS',
                'LogOutflow', 'NetFlow', 'SuccessdByte', 'SuccessdLines', 'SumQPS',
            ]
        }
    ]
}
{% endblock %}

{% block filters%}
{% endblock %}

{% block run %}
@DFF.API('{{ dff_api_title }}', timeout=300, fixed_crontab='{{ dff_api_crontab }}')
def run():
    collectors = [
        monitor_main.DataCollector(account, monitor_configs)
    ]

    Runner(collectors).run()
{% endblock %}
